package cn.service;

import java.util.List;

import cn.mapper.RoleMapper;
import cn.mapper.RoleMappleImp;
import cn.pojo.Role;

public class RoleServiceImpl implements RoleService {
	private RoleMapper roleMapper = new RoleMappleImp();

	@Override
	public Role getRoleById(Integer userRole) {
		return roleMapper.getRoleById(userRole);
	}

	@Override
	public List<Role> getAllRoles() {
		return roleMapper.getAllRoles();
	}

	@Override
	public int addRole(Role role) {
		return roleMapper.addRole(role);
	}

	@Override
	public int totalCount(String roleName) {
		return roleMapper.totalCount(roleName);
	}

	@Override
	public List<Role> getRoleLike(String roleName, Integer rowNum, int pagecount) {
		return roleMapper.getRoleLike(roleName, rowNum, pagecount);
	}

	@Override
	public Role getRoleByRoleCode(String roleCode) {
		// TODO Auto-generated method stub
		return roleMapper.getRoleByRoleCode(roleCode);
	}

	@Override
	public Role getRoleByRoleName(String roleName) {
		return roleMapper.getRoleByRoleName(roleName);
	}

	@Override
	public int roleRemove(String id) {
		// TODO Auto-generated method stub
		return roleMapper.roleRemove(id);
	}

	@Override
	public Integer[] deleteAll(String[] id) {
		// TODO Auto-generated method stub
		return roleMapper.deleteAll(id);
	}

}
